package com.bw.exam.controller;



import com.alibaba.fastjson.JSON;
import com.bw.exam.pojo.TypeTemplate;
import com.bw.exam.result.R;
import com.bw.exam.service.TypeTemplateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/business/typeTemplate")
@Slf4j
public class TypeTmeplateController {

    @Resource
    TypeTemplateService typeTemplateService;

    @RequestMapping("findById/{id}")
    public R byPid(@PathVariable Long id){

        log.info("模版id:{}",id);
        TypeTemplate typeTemplate = typeTemplateService.getByIdOptions(id);

        log.info("模版 typeTemplate:{}", JSON.toJSONString(typeTemplate));

        return R.success(typeTemplate);
    }

}
